<template>
  <!-- :visible='value'  @update:visible="value=$event" -->
  <el-dialog title="扫码预览" :visible="value" @close="$emit('input',false)">
    <div style="text-align:center">
      <canvas ref="canvas" />
    </div>
  </el-dialog>
</template>
<script>
import Qrcode from 'qrcode'
export default {
  props: {
    value: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      // show: false
    }
  },
  methods: {
    createCode(imgUrl) {
      console.log(this.$refs.canvas)
      Qrcode.toCanvas(this.$refs.canvas, imgUrl, {
        width: 300
      })
    }
  }
}
</script>
<style>
</style>
